<template>
  <img ref="img" v-if="src" :src="src" :style="{width: '70px', height: '70px'}" v-bind="$attrs" v-on="$listeners" @click="preview">
  <span v-else>无</span>
</template>

<script>
export default {
  props: {
    src: {
      type: String,
      default: ''
    }
  },
  methods: {
    preview() {
      const { src } = this.$refs.img
      if (!src) return
      this.$preview(src)
    }
  }
}
</script>

<style>
</style>
